package com.gitee.ywj1352.webFlux.load;

import java.util.stream.Stream;

/**
 * @author wenjie.yang on 2019/7/16.
 */
public class StreamDemo {

    public static void main(String[] args) {
        //写法很直观
        Stream.of(1,2,3,4)
                .filter(v->v%2==1)
                .map(v->v-1)
                .reduce(Integer::sum).ifPresent(System.out::println); //聚合操作
                //.forEach(System.out::println);
    }

}
